<style type="text/css">
    #grid td {
        word-break: break-all;
    }
</style>
<div>
    <div class="table-header mt5 clearfix ng-scope search">
        <span class="fl lh30 f14 mr25">认筹活动管理</span>
        <input class="input-text fl ng-pristine ng-untouched ng-valid" style="width: 470px;" type="text"
               placeholder="活动名称" ng-model="keyword" ng-enter="search()"/>
        <a class="btn" href="javascript: void(0)" ng-click="search()">查询</a>
    </div>

    <my-nav ng-model="currStatus" data-nav-items="filterDataStatus" onchanged="search" data-title="活动状态:"></my-nav>

    <div class="table-header mt20 clearfix ng-scope">
        <span class="fl lh30 f14">活动列表</span>

        <div class="fr btn-group">

            <a href="javascript:void(0)" class="btn permission p-502101-01"
               title="新增活动"
               ui-dialog="新增活动"
               ui-dialog-data="baseData"
               ui-dialog-show="activitiesSvr.initEditActivitiesDialog($data, $dialog,$dialogScope)"
               ui-dialog-ok="activitiesSvr.save($data, $dialog)"
               ui-dialog-cache="false"
               ui-dialog-url="activities/edit.html"
                    >新增活动</a>
        </div>
    </div>

    <div id="grid" class="table-wrap mt10" style="overflow:visible;">
        <table width="100%" class="valign-t">
            <thead>
            <tr>
                <th width="35">序号</th>
                <th width="130">认筹楼盘项目</th>
                <th width="130">认筹活动主题名称</th>
                <th width="200">活动优惠信息</th>
                <th width="80">活动开始时间</th>
                <th width="80">活动结束时间</th>
                <th width="100" class="text-center">二维码</th>
                <th width="80" class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="record in activitiesSvr.activities"
                ng-mouseover="record.hover = true"
                ng-mouseleave="record.hover = false">
                <td height="40"><p ng-bind="$index + 1 + ((activitiesSvr.filter.pageIndex-1)*activitiesSvr.filter.pageSize)"></p></td>
                <td>
                    {{record.lp_name}}
                </td>
                <td>
                    <p ng-bind="record.name"></p>
                </td>
                <td>
                    <p>{{ record.discount }}</p>
                </td>
                <td>
                    <p>{{record.start_date|strdate:'yyyy-MM-dd'}}</p>
                </td>
                <td>
                    <p>{{record.end_date|strdate:'yyyy-MM-dd'}}</p>
                </td>
                <td class="text-center">
                    <div style="position: relative;display: block;overflow:visible;">
                        <span class="showqr c-orange" ng-click="activitiesSvr.showQR = record.teambuy_id" style="cursor:pointer"
                              ng-show="record.material_qrurl"
                                >物料推广</span>

                        <div class="top-userinfo-menu ng-hide" style="display: block;top:20px;z-index:1;"

                             ng-show="activitiesSvr.showQR == record.teambuy_id && record.material_qrurl"
                                >
                            <div class="top-userinfo-menu-list text-left" style="width:225px;">
                                <div class="form-group clearfix">
                                    <div class="col-sm-8" style="padding:0">
                                        <img style="width:150px;height:150px;" ng-src="{{record.material_qrurl}}"/>
                                    </div>
                                    <div class="col-sm-4" style="padding:0;line-height:180%;">
                                        <p class="mt10" ><a clipboard href="javascript:void(0)" content="record.qrUrl" aftercopy="aftercopyNotify()" style="color:#ff7713!important;">复制链接</a></p>
                                        <p><a style="color:#ff7713!important;" href="{{ record.material_qrurl}}" target="_blank">下载</a></p>
                                    </div>
                                </div>
                            </div>
                            <i class="top-userinfo-menu-arrow"></i>
                        </div>

                    </div>
                </td>
                <td>
                    <a href="javascript:void(0)"
                       title="查看活动"
                       ui-dialog="查看活动"
                       ui-dialog-data="baseData"
                       ui-dialog-show="activitiesSvr.initEditActivitiesDialog($data, $dialog,$dialogScope, record)"
                       ui-dialog-ok=""
                       ui-dialog-cache="false"
                       ui-dialog-url="activities/edit.html"
                       class="mt5 c-orange ng-hide  permission p-502101-00-inline" ng-show="record.hover||true"
                       ng-if="record.publish_status == 1"
                            >查看</a>
                    <a href="javascript:void(0)"
                       title="编辑活动"
                       ui-dialog="编辑活动"
                       ui-dialog-data="baseData"
                       ui-dialog-show="activitiesSvr.initEditActivitiesDialog($data, $dialog,$dialogScope, record)"
                       ui-dialog-ok="activitiesSvr.save($data, $dialog)"
                       ui-dialog-cache="false"
                       ui-dialog-url="activities/edit.html"
                       class="mt5 c-orange ng-hide permission p-502101-02-inline" ng-show="record.hover||true"
                       ng-if="record.publish_status == 0"
                            >编辑</a>
                    <a ng-click="activitiesSvr.setStatus(record, 1)" href="javascript:void(0)"
                       title="上架"
                       class="mt5 c-orange ng-hide permission p-502101-04-inline" ng-show="record.hover||true"
                       ng-if="record.publish_status == 0"
                            >上架</a>
                    <a ng-click="activitiesSvr.setStatus(record, 0)" href="javascript:void(0)"
                       class="mt5 c-orange ng-hide permission p-502101-04-inline" ng-show="record.hover||true"
                       ng-if="record.publish_status == 1"
                       title="下架">下架</a>
                    <a ng-click="activitiesSvr.delete(record)" href="javascript:void(0)"
                       class="mt5 c-orange ng-hide permission p-502101-05-inline" ng-show="record.hover||true"
                       ng-if="record.publish_status == 0"
                       title="删除">删除</a>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="no-data" ng-if="activitiesSvr.activities.length == 0"><span>暂无数据</span></div>
    </div>
    <div ui-pagination page-index="activitiesSvr.filter.pageIndex" page-size="filter.pageSize" total="activitiesSvr.total"
         changed="getActivitiesData($pageIndex)"></div>
</div>
